import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import About from '@/components/About'
import Player from '@/components/Player'
import News from '@/components/News'
import Other from '@/components/Other'
import OtherPage from '@/components/OtherPage'
import page01 from '@/components/page01'

import page01A from '@/components/page01/page01-A'
import page01B from '@/components/page01/page01-B'
import page01C from '@/components/page01/page01-C'

import News2 from '@/components/News2'
import News1 from '@/components/News1'

import NewsInfo from '@/components/NewsInfo'
//设置路由，用于绑定自定义
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'HelloWorld',
      component: HelloWorld
    },
    {
      path: '/about',
      name: 'About',
      component: About
    },
    {
      path: '/player/:uid',//动态路由
      name: 'Player',
      component: Player
    },
    {
      path: '/news/:nid',//动态路由
      name: 'News',
      component: News
    },
    {
      path: '/other',//动态路由
      name: 'Other',
      component: Other,
      // children:[
      //   {
      //     path:'/other/:name/:age',
      //     component:OtherPage,
      //   },

      // ],
    },
    {
      path: '/otherPage/:id',
      name: 'OtherPage',
      component: OtherPage
    },
    {
      path: '/page01',
      name: 'page01',
      component: page01,
      children: [
        {
          path: '1',
          name: 'page01A',
          component: page01A
        },
        {
          path: '2',
          name: 'page01B',
          component: page01B,
        },
        {
          path: '3',
          name: 'page01C',
          component: page01C,
        }
      ]
    },
    {
      path: '/news2',
      name: 'News2',
      component: News2
    },

    {
      path: '/news1',
      name: 'News1',
      component: News1,
      children: [{
        path: 'newsinfo',
        name: 'NewsInfo',
        component: NewsInfo,
      }]
    },
  ]
})
